# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jhkim

from coin.strategy.mm.base.feed_arb_base import (FeedArbSubscriberHandler, FeedArbSubsystem)
from coin.strategy.mm.subscription import SubscriptionRequest

from coin.exchange.huobi_futures.ws.subscriber import HuobiFuturesSubscriber
from coin.strategy.mm.feed_arb import (HuobiFuturesFeedArbFlowBookBuilder)


class HuobiFuturesFeedArbSubscriberHandler(FeedArbSubscriberHandler):
  SubscriberType = HuobiFuturesSubscriber


class HuobiFuturesFeedArbSubsystem(FeedArbSubsystem):
  FlowBookBuilder = HuobiFuturesFeedArbFlowBookBuilder
  FeedSubscriber = HuobiFuturesFeedArbSubscriberHandler
  FeedSubReq = SubscriptionRequest('Futures', 'Huobi', None)

  def set_price_limit_error_callback(self, callback):
    self._price_limit_error_callback = callback
